import 'package:ecy_app_flutter/ecycommon/EcyCommonWidgetRealtedInterface.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:meta/meta.dart';
import 'package:ecy_app_flutter/constant/color_constant.dart';

import 'EcyHttpRealtedInterface.dart';

class EcyCommonBaseWidget extends StatefulWidget
    implements EcyCommonWidgetRealtedInterface {
  int statutBarHeigh = 0;
  EcyCommonBaseWidget({super.key}) {
    init();
  }

  @override
  State<EcyCommonBaseWidget> createState() {
    return EcyCommonBaseWidgetState();
  }

  @override
  void showLoading() {
    EasyLoading.show(status: '加载中...');
  }

  @override
  void dismissLoading() {
    EasyLoading.dismiss();
  }

  @override
  void init() {}

  @override
  Widget emptyView() {
    // TODO: implement emptyView
    return Text("");
  }
}

class EcyCommonBaseWidgetState extends State<EcyCommonBaseWidget>
    implements EcyHttpRealtedInterface {
  bool isLoggedIn = false;
  String title = "";
  late BuildContext _context;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: ColorConstant.White,
        appBar: AppBar(
          backgroundColor: ColorConstant.White,
          title: Text(title),
        ));
  }

  @override
  void requestData() {
    // TODO: implement requestData
  }
}
